import { reqGetSearchInfo } from "@/api";
//search模块小仓库
const state = {
    //仓库初始状态
    searchList: {},
};
const mutations = {
    GETSEARCHLIST(state, searchList) {
        state.searchList = searchList;
    }
};
const actions = {
    //获取search模块数据
    async getSearchList({ commit }, Search = {}) {
        //调用数据时至少传一个参数
        //params:当用户派发action时,第二个参数传过来的
        let result = await reqGetSearchInfo(Search);
        if (result.code == 200) {
            commit("GETSEARCHLIST", result.data);
        }
    }
};
//为了简化获取的数据而存在
const getters = {
};
export default {
    state,
    mutations,
    actions,
    getters
}